package com.wildwolf.project.wildwolf.ui.buddy;

import com.wildwolf.project.wildwolf.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class BuddySearchActivity extends Activity implements OnClickListener {
private EditText editTextBuddyAccountName = null;

private TextView textViewBuddySearchBtn= null;

private TextView textViewBuddyReturnBtn= null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_buddy_search);
		/**
		 * 
		 */
		editTextBuddyAccountName = (EditText) findViewById(R.id.buddy_search_editText_accountName);
		textViewBuddySearchBtn = (TextView) findViewById(R.id.buddy_search_textView_search);
		textViewBuddyReturnBtn = (TextView) findViewById(R.id.buddy_search_textView_return);
		textViewBuddySearchBtn.setOnClickListener(this);
		textViewBuddyReturnBtn.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		if(v==textViewBuddyReturnBtn){
			finish();
		}else{
			if("".equals(editTextBuddyAccountName.getText())||editTextBuddyAccountName.getText().toString().trim().length()==0){
				Toast.makeText(this, R.string.buddy_search_tips_msg, Toast.LENGTH_SHORT).show();
			}else{
				Toast.makeText(this, editTextBuddyAccountName.getText(), Toast.LENGTH_SHORT).show();
			}
		}
	
	}

}
